package com.flyu.myThread.lamada;

public class TestLamada2 {

    public static void main(String[] args) {
        // 1. lamada 表示简化
        Ilove ilove = (int a) -> {
            System.out.println("I love you --> "+ a);
        };
        ilove.love(520);
        // 2. 简化参数类型
        ilove = (a)-> {
            System.out.println("I love you --> "+ a);
        };
        ilove.love(521);
        // 3. 简化括号
        ilove = a -> {
            System.out.println("I love you --> "+ a);
        };
        ilove.love(522);
    }
}

interface Ilove{
    void love(int a);
}

class Love implements Ilove{

    @Override
    public void love(int a) {
        System.out.println("I love you --> "+ a);
    }
}
